//
//  AlertViewController.swift
//  MoodDiary
//
//  Created by MoodDiary on 2020/11/24.
//

import UIKit

protocol AlertViewControllerDelegate: class {
    func alertViewControllerSureAction(alertTitle: String?)
}

class AlertViewController: UIViewController {

    @IBOutlet weak var contentLabel: UILabel!
    
    weak var delegate: AlertViewControllerDelegate?
    
    var alertTitle: String?
    
    override func viewDidLoad() {
        super.viewDidLoad()

        contentLabel.text = alertTitle
    }

    @IBAction func closeAction() {
        dismiss(animated: true, completion: nil)
    }
    
    @IBAction func sureAction() {
        delegate?.alertViewControllerSureAction(alertTitle: alertTitle)
        dismiss(animated: true, completion: nil)
    }
    
}
